package com.yc.project1;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author zwei
 * @create 2024-07-31 19:11
 */
public class App_main {
    public static void main(String[] args) throws SQLException {
        ApplicationContext ac=new AnnotationConfigApplicationContext(AppConfig.class);
        DruidDataSource ds= (DruidDataSource) ac.getBean("druidDataSource");
        System.out.println(ds);
        //连接数据库
        Connection cn=ds.getConnection();
        System.out.println(cn);
        BankBiz bb= (BankBiz) ac.getBean("bankBiz");
        bb.showAll();
    }
}
